#include <stdio.h>

void Readscore(int score[],int* count)
{
    int i = 0;
    int val;
    int cnt = 0;
    printf("请输入学生成绩，以负数代表结束:");
    while(scanf("%d",&val) != EOF)
    {
        score[i] = val;
        cnt++;
    }
    *count = cnt;
}

int main()
{
    int* score;
    int count;
    ReadScore(&score,&count);
    printf("sum = %d",count);
    return 0;
}
